package com.example.wanbaqian.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;

import com.example.wanbaqian.R;
import com.example.wanbaqian.bean.AllRepaylistBean;
import com.example.wanbaqian.bean.FindBankInfoListBean;
import com.example.wanbaqian.utils.TimeUtils;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by pengfei on 2017/8/12 0012.
 * description：<p>还款列表</p>
 */

public class FindbankinfoListAdpter extends CommonAdapter<FindBankInfoListBean> {

    public FindbankinfoListAdpter(Context context, int layoutId, List<FindBankInfoListBean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    public void onViewHolderCreated(ViewHolder holder, View itemView) {
        super.onViewHolderCreated(holder, itemView);
        AutoUtils.autoSize(itemView);
    }

    @Override
    protected void convert(ViewHolder holder, FindBankInfoListBean item, int position) {
        holder.setText(R.id.txt_older_id, "业务订单号：" + item.getLoan_no());
        holder.setText(R.id.lendmoney, item.getLoan_money());
        if (item.getPay_status().equals("0")) {
            holder.setText(R.id.txt_type, "打款中");
        } else if (item.getPay_status().equals("1")) {
            holder.setText(R.id.txt_type, "打款成功");
        } else if (item.getPay_status().equals("2")) {
            holder.setText(R.id.txt_type, "打款失败");
        }
        holder.setText(R.id.txt_lenddays,item.getLoan_days());
        holder.setText(R.id.txt_data1, TimeUtils.getStringnumber(item.getLoan_time()));
        holder.setText(R.id.txt_data2, TimeUtils.getStringData(item.getLoan_time()));
        holder.setText(R.id.txt_bank_account, "到账银行卡：" + item.getBank_account());
    }

}
